import { Component, OnInit } from '@angular/core';
import {NavigationExtras, Router} from "@angular/router";

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styles: [
  ]
})
export class HomeComponent implements OnInit {
  name = ''
  constructor(private router: Router) { }

  ngOnInit(): void {
  }

  renderHeader() {
    return '列表';
  }

  jumpRouter(){
    // const routerParams: NavigationExtras  = {
    //   queryParams: {
    //     name: "Kitty"
    //   }
    // };
    // this.router.navigate(["/router"], routerParams)
    this.router.navigate(["/router"],{
      queryParams: {
        name: "Kitty"
      }
    })
  }

  onChange(event: { name: string }) {
    // console.log(event)
    this.name = event.name;
  }
}
